package com.example.bsxk.service.impl;

import com.example.bsxk.dao.ZyxStudentChoosedThesisDao;
import com.example.bsxk.dao.ZyxStudentThesisDao;
import com.example.bsxk.dto.ZyxStudentChoosedThesis;
import com.example.bsxk.dto.ZyxStudentThesis;
import com.example.bsxk.entity.User;
import com.example.bsxk.mapper.UserMapper;
import com.example.bsxk.service.ZyxUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZyxUserServiceImpl implements ZyxUserService {
    @Autowired
    UserMapper userMapper;
    @Autowired
    ZyxStudentChoosedThesisDao dao;
    @Autowired
    ZyxStudentThesisDao thesisDao;

    @Override
    public List<ZyxStudentChoosedThesis> findChooseThesesById(Long id) {
        List<ZyxStudentChoosedThesis> chooseThesesById = dao.findChooseThesesById(id);
        return chooseThesesById;
    }

    @Override
    public List<ZyxStudentChoosedThesis> findOptionalThesesById(Long id) {
        List<ZyxStudentChoosedThesis> choosedTheses = dao.findOptionalThesesById(id);
        return choosedTheses;
    }

    @Override
    public List<ZyxStudentChoosedThesis> findNotChooseThesesById(Long id) {
        List<ZyxStudentChoosedThesis> notChooseThesesById = dao.findNotChooseThesesById(id);
        return notChooseThesesById;
    }

    @Override
    public int findThesisCount(Integer tid) {

        return dao.findThesisCount(tid);
    }

    @Override
    public int findThesisCountById(Long id) {
        return dao.findThesisCountById(id);
    }

    @Override
    public void insertThesis(ZyxStudentThesis thesis) {

        thesisDao.insert(thesis);
    }

    @Override
    public void deleteById(ZyxStudentThesis thesis) {

        thesisDao.delete(thesis);
    }
}